﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace 车牌识别系统1
{
    public partial class Form7 : Form
    {
        public Form7()
        {
            InitializeComponent();
        }

        private void Form7_Load(object sender, EventArgs e)
        {
            toolStripStatusLabel1.Text = "用户名:" + Form5.id;
            toolStripStatusLabel2.Text = "  ||  登陆时间:" + DateTime.Now.ToLongTimeString();
            toolStripStatusLabel3.Text = "查看了注册人员表";
            string SqlStr = "server=.;database=cpsm;integrated security=SSPI";
            SqlConnection conn = new SqlConnection(SqlStr);
            conn.Open();
            SqlDataAdapter sqlda = new SqlDataAdapter("select * from table_2 ", conn);
            DataSet myds = new DataSet();
            sqlda.Fill(myds, "table_2");
            dataGridView1.DataSource = myds.Tables["table_2"];
        }

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("是否退出本系统？", "退出", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                Application.Exit();
            else
            {
                Form1 f1 = new Form1();
                f1.Show();
            }
        }

        private void 添加管理员ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form8 f8 = new Form8();
            f8.Show();
            this.Hide(); 
        }

        private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }
    }
}
